package com.edu.imau.IC_CARD;

import com.edu.imau.ParkingDao;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author ljx
 * @date 2022/12/29 12:57
 */
@WebServlet("/ICdelete")
public class ICDeleteServlet extends HttpServlet {
    ParkingDao dao = new ParkingDao();

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //1:处理参数
        String id_str = request.getParameter("card_id");
        //2 调用model
        if (id_str != null) {
            dao.deleteIC(Integer.parseInt(id_str));
            //3；展示数据View
            response.sendRedirect("icmanager.jsp");
        }
    }
}